import random

class Deck:

    def __init__(self,size):
        self.card_list = [i for i in range(size)]
        random.shuffle(self.card_list)
        self.current_card = 0
        self.size = size

    def deal(self):
        if self.size - self.current_card < 1:
            random.shuffle(self.card_list)
            self.current_card = 0
            print('Reshuffling...!!!')
        self.current_card += 1
        return self.card_list[self.current_card -1]


ranks = ['2','3','4','5','6','7','8','9','10','J','Q','K','A']
suits = ['clubs','diamonds','hearts','spades']
my_deck = Deck(52)

# 发 12 手牌（每手5张），用户可对洗牌前后进行对比
for i in range(12):
    for j in range(5):
        d = my_deck.deal()
        r = d % 13
        s = d // 13
        print(ranks[r],'of',suits[s])
    print()



